﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.Services;
using Generico.Coneccion;

namespace RosarioFinanzas
{
    public partial class Comenta : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            HttpContext.Current.Session.Add("IdArticuloComentario", Request.QueryString["id"].ToString());
        }
        [WebMethod(EnableSession = true)]
        public static string strComentar()
        {
            string str = string.Empty;
            if (HttpContext.Current.User.Identity.IsAuthenticated)
            {
                str = "Comentar";
            }
            return str;
        }
        [WebMethod(EnableSession = true)]
        public static string NewComentar(string Comentario)
        {
            var cn = new ClsConeccion();
            cn.Abrir();
            cn.AgregarParametros("idArticulo", Convert.ToInt32(HttpContext.Current.Session["IdArticuloComentario"]));
            cn.AgregarParametros("Comentario", Comentario);
            cn.AgregarParametros("Usuario", HttpContext.Current.User.Identity.Name);
            cn.EjecutarSp("sp_NewComentario");
            cn.Cerrar();
            HttpContext.Current.Session.Remove("IdArticuloComentario");
            return string.Empty;
        }
    }
}